package fifthwork.two.inherit;

import fifthwork.two.Shape;

/**
 * @author ：chenzikang
 * @date ： 2020/3/24
 */

public class CircleShape extends Shape {

    public CircleShape(double radius) {
        this.radius = radius;
    }

    private static final double pi = 3.14;
    private double radius;

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    @Override
    public double area() {
        return getRadius() * getRadius() * pi;
    }
}
